package br.com.wagnerpaz.battlemaniacs.model;

import java.util.HashMap;
import java.util.Map;

public class Status
{
	private Map<Attribute, AttributeValue> attributes;
	private Equipment equipment;

	public Status()
	{
		attributes = new HashMap<Attribute, AttributeValue>();
		
		for( Attribute att : Attribute.values() )
		{
			attributes.put( att, new AttributeValue(0) );
		}
	}
	
	public Integer getValue(Attribute att)
	{
		return attributes.get(att).getValue();
	}
	
	public void setValue(Attribute att, Integer value)
	{
		attributes.get(att).setValue(value);
	}
	
	public void sumValue(Attribute att, Integer value)
	{
		int old = attributes.get(att).getValue();
		attributes.get(att).setValue(old + value);
	}
	
	public Integer getMax(Attribute att)
	{
		return attributes.get(att).getMax();
	}
	
	public void setMax(Attribute att, Integer value)
	{
		attributes.get(att).setMax(value);
	}
	
	public void sumMax(Attribute att, Integer value)
	{
		int old = attributes.get(att).getMax();
		attributes.get(att).setMax(old + value);
	}

	public Equipment getEquipment()
	{
		return equipment;
	}

	public void setEquipment(Equipment equipment)
	{
		this.equipment = equipment;
	}

	public Map<Attribute, AttributeValue> getAttributes()
	{
		return attributes;
	}

	public void setAttributes(Map<Attribute, AttributeValue> attributes)
	{
		this.attributes = attributes;
	}
}
